package com.vimi8.ebb.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.sf.json.JSONArray;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;


/**
 * 用户实体,仅包含oauth认证和授权所需的必须字段.
 **/

/**
 * 用户实体,仅包含oauth认证和授权所需的必须字段.
 */
@ApiModel(description = "用户实体,仅包含oauth认证和授权所需的必须字段.")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-10-14T06:47:35.435Z")

public class AuthUser   {
  private String userId = null;

  private String idCard = null;

  private String userName = null;

  private String phoneNumber = null;

  private String realName = null;

  private String nickName = null;

  private String headImg = null;

  private Integer sex = null;

  private String addressCode = null;

  private String addressDetail = null;

  private String defaultClientId = null;

  private String remark;

  private List<String> orgImages=new ArrayList<>();

  private String orgName=null;

  private String isAuth=null;



  public String getIsAuth() {
    return isAuth;
  }

  public void setIsAuth(String isAuth) {
    this.isAuth = isAuth;
  }

  public String getOrgName() {
    return orgName;
  }

  public void setOrgName(String orgName) {
    this.orgName = orgName;
  }

  public List<String> getOrgImages() {
    return orgImages;
  }

  public void setOrgImages(String orgImages) {
    if(StringUtils.isEmpty(orgImages)){
      this.orgImages=new ArrayList<>();
    }else{
      JSONArray jsonArray=JSONArray.fromObject(orgImages);
      List<String> list=jsonArray.toList(jsonArray,String.class);
      this.orgImages = list;
    }

  }


  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public AuthUser userId(String userId) {
    this.userId = userId;
    return this;
  }

   /**
   * 用唯一标识.
   * @return userId
  **/
  @ApiModelProperty(value = "用唯一标识.")
  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  public AuthUser idCard(String idCard) {
    this.idCard = idCard;
    return this;
  }

   /**
   * 身份证编号.
   * @return idCard
  **/
  @ApiModelProperty(value = "身份证编号.")
  public String getIdCard() {
    return idCard;
  }

  public void setIdCard(String idCard) {
    this.idCard = idCard;
  }

  public AuthUser userName(String userName) {
    this.userName = userName;
    return this;
  }

   /**
   * 用户名.
   * @return userName
  **/
  @ApiModelProperty(value = "用户名.")
  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public AuthUser phoneNumber(String phoneNumber) {
    this.phoneNumber = phoneNumber;
    return this;
  }

   /**
   * 手机号.
   * @return phoneNumber
  **/
  @ApiModelProperty(value = "手机号.")
  public String getPhoneNumber() {
    return phoneNumber;
  }

  public void setPhoneNumber(String phoneNumber) {
    this.phoneNumber = phoneNumber;
  }

  public AuthUser realName(String realName) {
    this.realName = realName;
    return this;
  }

   /**
   * 真实姓名.
   * @return realName
  **/
  @ApiModelProperty(value = "真实姓名.")
  public String getRealName() {
    return realName;
  }

  public void setRealName(String realName) {
    this.realName = realName;
  }

  public AuthUser nickName(String nickName) {
    this.nickName = nickName;
    return this;
  }

   /**
   * 昵称.
   * @return nickName
  **/
  @ApiModelProperty(value = "昵称.")
  public String getNickName() {
    return nickName;
  }

  public void setNickName(String nickName) {
    this.nickName = nickName;
  }

  public AuthUser headImg(String headImg) {
    this.headImg = headImg;
    return this;
  }

   /**
   * 头像.
   * @return headImg
  **/
  @ApiModelProperty(value = "头像.")
  public String getHeadImg() {
    return headImg;
  }

  public void setHeadImg(String headImg) {
    this.headImg = headImg;
  }

  public AuthUser sex(Integer sex) {
    this.sex = sex;
    return this;
  }

   /**
   * 性别.
   * @return sex
  **/
  @ApiModelProperty(value = "性别.")
  public Integer getSex() {
    return sex;
  }

  public void setSex(Integer sex) {
    this.sex = sex;
  }

  public AuthUser addressCode(String addressCode) {
    this.addressCode = addressCode;
    return this;
  }

   /**
   * 地址代码.
   * @return addressCode
  **/
  @ApiModelProperty(value = "地址代码.")
  public String getAddressCode() {
    return addressCode;
  }

  public void setAddressCode(String addressCode) {
    this.addressCode = addressCode;
  }

  public AuthUser addressDetail(String addressDetail) {
    this.addressDetail = addressDetail;
    return this;
  }

   /**
   * 地址详情.
   * @return addressDetail
  **/
  @ApiModelProperty(value = "地址详情.")
  public String getAddressDetail() {
    return addressDetail;
  }

  public void setAddressDetail(String addressDetail) {
    this.addressDetail = addressDetail;
  }

  public AuthUser defaultClientId(String defaultClientId) {
    this.defaultClientId = defaultClientId;
    return this;
  }

   /**
   * 默认客户域(组织)标识.
   * @return defaultClientId
  **/
  @ApiModelProperty(value = "默认客户域(组织)标识.")
  public String getDefaultClientId() {
    return defaultClientId;
  }

  public void setDefaultClientId(String defaultClientId) {
    this.defaultClientId = defaultClientId;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AuthUser authUser = (AuthUser) o;
    return Objects.equals(this.userId, authUser.userId) &&
        Objects.equals(this.idCard, authUser.idCard) &&
        Objects.equals(this.userName, authUser.userName) &&
        Objects.equals(this.phoneNumber, authUser.phoneNumber) &&
        Objects.equals(this.realName, authUser.realName) &&
        Objects.equals(this.nickName, authUser.nickName) &&
        Objects.equals(this.headImg, authUser.headImg) &&
        Objects.equals(this.sex, authUser.sex) &&
        Objects.equals(this.addressCode, authUser.addressCode) &&
        Objects.equals(this.addressDetail, authUser.addressDetail) &&
        Objects.equals(this.defaultClientId, authUser.defaultClientId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(userId, idCard, userName, phoneNumber, realName, nickName, headImg, sex, addressCode, addressDetail, defaultClientId);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AuthUser {\n");
    
    sb.append("    userId: ").append(toIndentedString(userId)).append("\n");
    sb.append("    idCard: ").append(toIndentedString(idCard)).append("\n");
    sb.append("    userName: ").append(toIndentedString(userName)).append("\n");
    sb.append("    phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
    sb.append("    realName: ").append(toIndentedString(realName)).append("\n");
    sb.append("    nickName: ").append(toIndentedString(nickName)).append("\n");
    sb.append("    headImg: ").append(toIndentedString(headImg)).append("\n");
    sb.append("    sex: ").append(toIndentedString(sex)).append("\n");
    sb.append("    addressCode: ").append(toIndentedString(addressCode)).append("\n");
    sb.append("    addressDetail: ").append(toIndentedString(addressDetail)).append("\n");
    sb.append("    defaultClientId: ").append(toIndentedString(defaultClientId)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

